Image data has multiple sampling resolutions. There is a temporal sampling rate, commonly called the frame rate, of motion picture data. Each image also has a vertical and horizontal sampling resolution indicating the number of individual elements, commonly called pixels, in the horizontal and vertical dimensions of the image. Each pixel typically is represented by a number of components to define a color. The components may represent luminance and chrominance (YCrCb, for example), or may represent color channels (red, green and blue, for example). A value for each component generally is represented using a number of bits called the bit depth. Typical bit depths used for images are eight bits, ten bits and sixteen bits.
High quality digital video processing systems often use a bit depth per component of ten bits. This bit depth provides a good tradeoff between quality and bandwidth and efficient implementation of processing functions in hardware. However, on a general-purpose computer, bit paths have a bit depth based on a power of two (e.g, eight, sixteen, thirty-two or sixty-four bits). Therefore, 10-bit data generally is converted to 16-bit data before it is processed by the computer. It would be inefficient however to transmit or to store the full sixteen bits.
Sometimes it is also desirable to process image data using a bit depth of only eight bits. An 8-bit representation may be obtained from a 10-bit representation by truncation or rounding. However, data would be lost if only eight bits were transmitted or stored.
To store 10-bit data on disk, techniques have been developed to pack the 10-bit data into data words having a bit depth based on a power of two (such as 8-bit and 32-bit words). For example, in U.S. Pat. No. 6,239,815, 10-bit YCrCb data for two pixels is packed into five bytes. Another commonly used packing format, referred to as “10:10:10:2,” is used, for example, in the OpenGL graphics system. OpenGL is a trademark of Silicon Graphics, Inc. In this format, three 10-bit values are stored in a 32-bit word, with two bits left unused. With this packed data, however, several operations are performed to extract either 8-bit or 10-bit data.